<%@ page import="org.biojava.dasobert.dasregistry.*" %>
<jsp:useBean id="register" class="dasregistry.registryBean" scope="session"/>
<jsp:setProperty name="register" property="*"/> 

<HTML>
<HEAD>
 <title>renew lease for DAS server</title>
<link rel="stylesheet" type="text/css" href="http://www.sanger.ac.uk/stylesheets/stylesheet.css" />
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</HEAD>

<BODY>

<%@ include file="sangerheader.jsp" %>

<jsp:include page="sangertitle.jsp" >
        <jsp:param name="title" value="renew lease for DAS server" />
</jsp:include>



<p>

<%@ include file="sangertablestart.jsp" %>
<%
    // init
    String serverurl = request.getParameter("url");
 %>
</p>
<h2> renewing lease for <%=serverurl%> <h2>

<p> If you renew the lease for a server, you tell the registry that
your service is still up and runnig correctly. If the lease for a
server if getting to old, it might be removed from the registry since
the server seems not to be maintained any longer. This mechanism will
get improtant once the DAS servers (e.g. dazzle, proserver) can
automatically register their services to this registry. </p>


<%

if ( serverurl != null ) {

// out.println(passkey);
// status can be: 
// 1: successfully renewed
// 0: some other error occured;

int status = register.renewLease(serverurl);

if ( status==1 ) {
	out.println(" successfully renewed lease for server ") ;
} else if ( status ==2) {
	%>
	<b>wrong key!</b>
	
	<%
		
} else {
	out.println("sorry, an unknown error occured");
}

} else {
%>
 
 no server url provided!
<%   
}

%>

<%@ include file="sangertableend.jsp" %>
<p>
<%@ include file="sangerfooter.jsp" %>
  </body>
</html>

